package org.bongo.open.cumulo.arbitrator.distribute;

import org.bongo.open.cumulo.core.context.CumuloContext;
import org.bongo.open.cumulo.core.message.MessageDistributable;

public abstract class MessageDistributorBase<T> implements
		MessageDistributor<T> {

	protected abstract int distributeIndex(MessageDistributable<T> distributable, CumuloContext context);
	
	protected void distributeToIndex(int index) {
		
	}
	
	public int distributeToSlot(MessageDistributable<T> distributable, CumuloContext context) {
		int slotIndex =  distributeIndex(distributable, context);
		
		distributeToIndex(slotIndex);
		
		return slotIndex;
	}

	
}
